#include "unp.h"

void str_echo(int fd)
{
    int n;
    char buf[MAXLINE];

again:
    while ( (n=read(fd, buf, sizeof(buf))) > 0) {
        Writen(fd, buf, n);
    }
    if (n < 0) {
        if (errno == EINTR) {
            goto again;
        } else {
            err_sys("read error");
        }
    }
}

